#pragma once
#include "ItemBase.h"

#include <QLabel>
#include <QHBoxLayout>

class LabelItem :
    public ItemBase
{
    Q_OBJECT
public:
    LabelItem(QWidget* parent) : ItemBase(parent)
    {
        m_label = new QLabel;
        auto mainLayout = new QHBoxLayout(this);
        mainLayout->addWidget(m_label);
        setLayout(mainLayout);
        qDebug() << "hhh+++LabelItem con end+++";
    }

    void setText(const QString& text)
    {
        m_text = text;
	    m_label->setText(text);
    }

    void up() override
    {
        setText("up");
    }

    void down() override
    {
        setText("down");
    }

    void enter() override
    {
        setText("enter");
    }

    void esc() override
    {
        setText(m_text);
    }
private:
    QString m_text;
    QLabel* m_label{ nullptr };
};

